<?php
require_once(dirname(__FILE__). '/application.php');
require_once(dirname(__FILE__). '/Session.php');
require_once(dirname(__FILE__). '/Zsystem.php');
require_once(dirname(__FILE__). '/Common.php');
require_once(dirname(__FILE__). '/Zlogin.php');

/* process script */
$script_name = script();
$currefer = uencode(strval($_SERVER['REQUEST_URI']));

/* session,cache,configure register */
Session::Init();
$INI = ZSystem::GetINI();
$cache = Cache::Instance();
$AJAX = ('XMLHttpRequest' == @$_SERVER['HTTP_X_REQUESTED_WITH']);
if (false==$AJAX) { 
    header('Content-Type: text/html; charset=UTF-8;'); 
} else {
    header("Cache-Control: no-store, no-cache, must-revalidate");
}

/* biz logic */
$currency = $INI['system']['currency'];
$login_user_id = ZLogin::GetLoginId();
$login_user = Table::Fetch('user', $login_user_id);
if (is_manager()) { 
	$cities = Utility::OptionArray(Table::Fetch('city', array_keys($INI['hotcity']), 'ename'), 'id', 'name');
}
$city = cookie_city(null);
if ($script_name==__FILE__) { Utility::Redirect( WEB_ROOT . '/index.php'); }
require_once($script_name);
